package com.trdcore.zyzkt.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @auther luffy
 * @create
 */
@Configuration
public class Swagger3Config
{
    @Bean
    public GroupedOpenApi TeacherServiceApi()
    {
        return GroupedOpenApi.builder().group("教师微服务模块").pathsToMatch("/admin/vod/**").build();
    }

    @Bean
    public GroupedOpenApi OrderServiceApi()
    {
        return GroupedOpenApi.builder().group("订单微服务模块").pathsToMatch("/admin/order/**").build();
    }
    @Bean
    public GroupedOpenApi OtherApi()
    {
        return GroupedOpenApi.builder().group("其它微服务模块").pathsToMatch("/other/**", "/others").build();
    }
    /*@Bean
    public GroupedOpenApi CustomerApi()
    {
        return GroupedOpenApi.builder().group("客户微服务模块").pathsToMatch("/customer/**", "/customers").build();
    }*/

    @Bean
    public OpenAPI docsOpenApi()
    {
        return new OpenAPI()
                .info(new Info().title("trdcore")
                        .description("通用设计rest")
                        .version("v1.0"))
                .externalDocs(new ExternalDocumentation()
                        .description("www.trdcore.com")
                        .url("https://trdcore.com/"));
    }
}
